package ru.budget.mobile.ui.base

import android.content.Context
import androidx.work.Worker
import androidx.work.WorkerParameters

class MyWork(
    context: Context,
    params: WorkerParameters
): Worker(context, params) {

    private val notificationService = BudgetNotificationService(context)

    override fun doWork(): Result {
        return try {
            notificationService.showNotification()
            Result.success()
        } catch (_: Exception) {
            Result.failure()
        }
    }
}